<%-- 
    Document   : search_client
    Created on : 30/Nov/2009, 15:05:23
    Author     : Daniel
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<jsp:useBean class="Cliente.WebGestor" id="webMyTwi" scope="session"/>

<%
String op = request.getParameter("search");
String []users = null;
String selected = null;

if ("Search".equalsIgnoreCase(op)){
    String searchString = request.getParameter("lookingforsomeone");
    System.out.println("----------------------------------------------"+searchString);
    users = webMyTwi.searchUsers(searchString);
}
%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <table>
            <tbody>
                <tr>
                    <td>
                        <form name="Search" action="select_username.jsp" target ="details_frame" method="post" >
                            <select name="lista_search" size="3" style="background:transparent; background-image:url(IMG/bg-txt.png);background-repeat:repeat">
                                <%
                                if (users!=null){
                                    for (int i = 1; i < users.length; i++){
                                    %>
                                    <option value="<%=users[i]%>" style="color:gray"> <%=users[i]%> </option>
                                    <%
                                    }
                                }
                                %>
                                <option style="color:gray" disabled>______________________</option>
                            </select>
                            <input type="submit" value="Detalhes" name="detalhes" />
                        </form>
                    </td>
                    <td><iframe src="select_username.jsp" width="220" frameborder="0" scrolling="0" height="90" name="details_frame"></iframe></td>
                </tr>
            </tbody>
        </table>
    </body>
</html>
